package com.dd.spineanimmodule;

import com.badlogic.gdx.Files;
import com.dd.spine.OnSpineClickListener;
import com.dd.spine.SpineBaseAdapter;

/**
 * Created by J.Tommy on 17/9/11.
 */

public class BoyAdapter extends SpineBaseAdapter {
    @Override
    public void onCreateImpl() {
        super.onCreateImpl();
        setAltasPath("spineboy/spineboy.atlas", Files.FileType.Internal);
        setSkeletonPath("spineboy/spineboy.json", Files.FileType.Internal);
        this.setOnSpineClickListener(new OnSpineClickListener() {
            @Override
            public void onClick() {
//                float srcScaleX = mSkeleton.findBone("head").getScaleX();
//                float srcScaleY = mSkeleton.findBone("head").getScaleY();
////                mSkeleton.findBone("head").setScale(srcScaleX * 0.8f, srcScaleY * 0.8f);
//                float srcPositionX = mSkeleton.findBone("head").getX();
//                float srcPositionY = mSkeleton.findBone("head").getY();
//                mSkeleton.findBone("head").setPosition(srcPositionX+20,srcPositionY);
            }
        });
    }

    @Override
    public void onCreatedImpl() {

    }

    @Override
    protected boolean onTouchDown(int screeX, int screenY, int pointer, int button) {
        return super.onTouchDown(screeX, screenY, pointer, button);
    }

    @Override
    protected boolean onTouchDragged(int screeX, int screenY, int pointer) {
        return super.onTouchDragged(screeX, screenY, pointer);
    }

    @Override
    protected boolean onTouchUp(int screeX, int screenY, int pointer, int button) {
        return super.onTouchUp(screeX, screenY, pointer, button);
    }

    //    @Override
//    public boolean onTouchDragged(int screenX, int screenY, int pointer) {
////                mSkeleton.findBone("head").setScale(srcScaleX * 0.8f, srcScaleY * 0.8f);
////        float srcPositionX = mSkeleton.findBone("head").getX();
////        float srcPositionY = mSkeleton.findBone("head").getY();
////
////        Bone bone = mSkeleton.findBone("head");
////        bone.setScale(0.2f);
////        float srcX=bone.getX();
////        float srcY=bone.getY();
////        bone.setPosition(srcX+moveX,srcY+moveY);
////        lastX=screenX;
////        lastY=screenY;
//        return false;
//    }

    @Override
    public void doClick() {

    }
}
